package vn.demand.dragon.controller
{
	import com.salesbuilder.control.TabManager;
	
	import mx.core.Container;
	
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;
	
	import vn.demand.dragon.model.QuotationProxy;
	import vn.demand.dragon.view.QuotationListMediator;
	
	public class CloseQuotationListCommand extends SimpleCommand
	{
		override public function execute( note:INotification ) :void    
		{
			var tab:Container = note.getBody() as Container;
			if (tab == null) return;
			if (facade.hasMediator(QuotationListMediator.NAME)) {
				facade.removeMediator(QuotationListMediator.NAME);
			}
			if (facade.hasProxy(QuotationProxy.NAME)) {
				facade.removeProxy(QuotationProxy.NAME)
			}			
			TabManager.removeTab(tab);
        }
	}
}